package com.hy.hongying.controller;

import com.hy.hongying.bo.VideoAddBO;
import com.hy.hongying.bo.VideoCallAdmireBo;
import com.hy.hongying.config.SystemConfig;
import com.hy.hongying.service.intf.VideoService;
import com.hy.hongying.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@CrossOrigin
@Api
@RestController
@RequestMapping("/hy/videoController/")
public class VideoController {
    @Autowired
    private VideoService service;
    @ApiOperation("上传视频的具体详情附属")
    @PostMapping("videoInsert.do")
   public R videoInsert(HttpServletRequest request, @RequestBody VideoAddBO bo){
        return service.videoInsert(request.getHeader(SystemConfig.USER_TOKEN),bo);
    }
    @ApiOperation("查看用户自己发布的视频")
    @PostMapping("videoMyself.do")
    public R videoMyself(HttpServletRequest request,Integer uid){
        return service.videoMyself(request.getHeader(SystemConfig.USER_TOKEN),uid);
    }
    @ApiOperation("用户查看生成的视频每次只生成3个有效的视频")
    @GetMapping("watchVideo.do")
    public R watchVideo(Integer type){
        return service.watchVideo(type);
    }
    @ApiOperation(" 用户作者自己删除自己的视频")
    @PostMapping("videoDel.do")
    public R videoDel(Integer oid){
        return service.videoDel(oid);
    }
    @ApiOperation("用户给视频投币")
    @PostMapping("videoCallAdmire.do")
    public R videoCallAdmire(HttpServletRequest request, VideoCallAdmireBo bo){
       return service.videoCallAdmire(request.getHeader(SystemConfig.USER_TOKEN),bo);
    }
    @ApiOperation("查询视频")
    @PostMapping("VideoLike.do")
    public R VideoLike(String title){
        return service.VideoLike(title);
    }

}
